{include file="public_head" /}

<!-- datatables -->
<link href="__STATIC__/js/datatables/jquery.dataTables.min.css" rel="stylesheet" type="text/css"/>
<!-- chk_3 -->
<link href="__STATIC__/css/chk_3.css" rel="stylesheet" type="text/css"/>

<body class="nav-md">

<div class="container body">


    <div class="main_container">

        {include file="public_sidebar,public_nav" /}

        <!-- page content -->
        <div class="right_col" role="main">
            <div class="">
                <div class="page-title">
                    <div class="title_left">
                        <h3>
                            商品分类管理
                        </h3>
                    </div>
                </div>
                <div class="clearfix"></div>

                <div class="row">

                    <div class="col-md-12 col-sm-12 col-xs-12">
                        <div class="x_panel">
                            <div class="x_title">
                                <h2>{$mate_title}</h2>
                                <a style="float: right" href="{:url('console/ShopGoodsType/create')}"
                                   class="btn btn-success btn-sm">创建商品分类</a>
                                <div class="clearfix"></div>
                            </div>
                            <div class="x_content">
                                <form name="form" id="form" method="post" action="">
                                    <table style="border-bottom:1px solid #ddd;width: 70%;margin: 0 15%"
                                           class="table table-striped table-bordered table-hover">
                                        <thead>
                                        <tr>
                                            <th style="width: 2%; padding: 10px;">
                                                <input type="checkbox" class="checkall"
                                                       onclick="CheckAll(this.checked);"/>
                                            </th>
                                            <th class="hidden-xs">排序</th>
                                            <th width="250">标题</th>
                                            <th>推荐分类</th>
                                            <th>是否启用</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        {empty name="data"}
                                            <tr><td colspan="5"><div style='font-size:24px;margin:30px 0;'>没有找到记录</div></td></tr>
                                        {/empty}
                                        {volist name="data" id="item"}
                                        <tr rel="rowpid_{$item.topId}">
                                            <td align="center">
                                                <input type="checkbox" name="id[]" value="{$item.id}"/>
                                            </td>
                                            <td width="150" align="center">
                                                <input class="form-control" style="width: 80px;text-align: center" type="text" name="sort[]" value="{$item.sort}">
                                                <input type="hidden" name="orderId[]" value="{$item.id}">
                                            </td>
                                            <td width="400" style="text-indent:{$item['count']*20}px;" align="left">

                                                {if condition="$item['parenTid'] eq '0'"}
                                                <span class="minusSign" id="rowid_{$item['id']}"
                                                      onclick="DisplayRows({$item['id']});">&nbsp;</span>
                                                {else/}
                                                <span class="subType">&nbsp;</span>
                                                {/if}

                                                {neq name="item.count" value="1"}|&nbsp;--&nbsp;{/neq}{$item.title}

                                            </td>
                                            <td width="100">
                                                <input type="checkbox" id="checkbox1_{$item.id}" class="chk_3" value="{$item.tj}" {eq name="item['tj']" value="1"}checked{/eq} />
                                                <label style="margin-left: 30px;margin-top: 5px;" onclick="CheckInfo('{:url(\'console/ShopGoodsType/tj\',[\'id\' => $item[\'id\']])}')" for="checkbox1_{$item.id}"></label>
                                            </td>
                                            <td width="100">
                                                <input type="checkbox" id="checkbox_{$item.id}" class="chk_3" value="{$item.status}" {eq name="item['status']" value="1"}checked{/eq} />
                                                <label style="margin-left: 30px;margin-top: 5px;" onclick="CheckInfo('{:url(\'console/ShopGoodsType/auditing\',[\'id\' => $item[\'id\']])}')" for="checkbox_{$item.id}"></label>
                                            </td>
                                            <td>
                                                <a href="{:url('console/ShopGoodsType/update', ['id' => $item['id']])}"
                                                   class="label label-primary">
                                                    <span class="fa fa-pencil"></span>&nbsp;&nbsp;编 辑
                                                </a>

                                                &nbsp;&nbsp;&nbsp;&nbsp;
                                                <a href="{:url('console/ShopGoodsType/destroy', ['id' => $item['id']])}"
                                                   class="label label-danger"
                                                   onClick="return confirm('系统会自动删除类别下所有子类别，确定删除吗?')"
                                                >
                                                    <span class="fa fa-times"></span>&nbsp;&nbsp;删 除
                                                </a>
                                            </td>
                                        </tr>
                                        {/volist}
                                        </tbody>
                                        <tbody align="left">
                                        <tr>
                                            <td colspan="5">
                                                <span>选择：</span>
                                                <a style="color:#428BCA" href="javascript:DelAllNone('{:url(\'console/ShopGoodsType/destroyAll\')}');" onclick="return ConfDelAll(0);">选择删除</a>
                                                &nbsp;&nbsp;&nbsp;&nbsp;
                                                <span>控制：</span>
                                                <a style="color:#428BCA" href="javascript:UpOrderID('{:url(\'console/ShopGoodsType/sorting\')}');">更新排序</a>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </form>
                            </div>
                        </div>
                    </div>

                </div>
            </div>

        </div>
        <!-- /page content -->
    </div>

</div>

{include file="public_foot" /}
<!-- public -->
<script src="__STATIC__/js/public.js"></script>
<!-- layer -->
<script src="__STATIC__/js/layer.js"></script>